from django.contrib import admin
from django.contrib.admin.models import LogEntry

from apps.users.models import UserProfile
from django.contrib.auth.admin import UserAdmin

# Register your models here.


ADDITIONAL_FIELDS = (('其它信息', {'fields': ('nick_name', 'birthday', 'gender', 'address', 'mobile', 'image')}),)


@admin.register(UserProfile)
class UserProfileAdmin(UserAdmin):
    fieldsets = UserAdmin.fieldsets + ADDITIONAL_FIELDS
    add_fieldsets = UserAdmin.fieldsets + ADDITIONAL_FIELDS


@admin.register(LogEntry)
class LogEntryAdmin(admin.ModelAdmin):
    list_display = ['object_repr', 'action_flag', 'user', 'change_message']


admin.site.site_header = '慕学网站管理后台'
admin.site.site_title = '慕学网站管理后台'
